//所有接口返回数据类型都有的ts类型
export interface ResponseData {
  code: number;
  message: string;
  ok: boolean;
}

//一个用户的类型
export interface User {
  id?: number;
  createTime?: string;
  updateTime?: string;
  username?: string;
  password?: string;
  name?: string;
  phone?: null;
  roleName?: string;
}

// 用户列表
export type UserRecords = User[];

// 用户列表返回类型
export interface UserResponseData extends ResponseData {
  data: {
    records: UserRecords;
    total: number;
    size: number;
    current: number;
    pages: number;
  };
}

// 角色类型
export interface RoleData {
  id?: number;
  roleName: string;
  createTime?: string;
  updateTime?: string;
  remark: null;
}

//角色数组
export type AllRole = RoleData[];

export interface AllRoleResponseData extends ResponseData {
  data: {
    allRolesList: AllRole;
    assignRoles: AllRole;
  };
}

export interface SetRoleData {
  roleIdList: number[];
  userId: number;
}
